/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.xcxAdmin.entity.ZtAdmin;

/**
 * 测试数据Entity
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Table(name = "zt_card_order", alias = "a", columns = {
		@Column(name = "id", attrName = "id", label = "编号", isPK = true),
		@Column(name = "order", attrName = "order", label = "订单号", queryType = QueryType.LIKE),
		@Column(name = "orderstatus", attrName = "orderstatus", label = "订单状态"),
		@Column(name = "order_time", attrName = "orderTime", label = "下单时间"),
		@Column(name = "pay_time", attrName = "payTime", label = "支付时间", isUpdate = true),
		@Column(name = "price", attrName = "price", label = "商品总价"),
		@Column(name = "cardid", attrName = "ztCard.id", label = "会员卡id"),
		@Column(name = "create_date", attrName = "createDate", label = "创建时间"),
		@Column(name = "status", attrName = "status", label = "状态"),
		@Column(name = "adminid", attrName = "ztAdmin.id", label = "小程序用户id"),
		@Column(name = "balance", attrName = "balance", label = "余额"),	

		 }, joinTable={
					@JoinTable(type=Type.LEFT_JOIN, entity=ZtAdmin.class, attrName="ztAdmin", alias="u10",
							on="u10.id = a.adminid", columns={
								@Column(name="name", label="小程序用户名",  queryType = QueryType.LIKE),
								@Column(name="headimgurl", label="小程序头像",attrName = "headimgurl"),}),
								
					@JoinTable(type=Type.LEFT_JOIN, entity=ZtCard.class, attrName="ztCard", alias="z",
								on="z.id = a.cardid", columns={
									@Column(name="name", label="小程序用户名",  queryType = QueryType.LIKE),
									
									@Column(name = "price", attrName = "price", label = "内容"),
									
									@Column(name = "copper_one_price_card", attrName = "copperOnePriceCard", label = "内容"),
									@Column(name = "copper_two_price_card", attrName = "copperTwoPriceCard", label = "内容"),
									@Column(name = "silver_one_price_card", attrName = "silverOnePriceCard", label = "内容"),
									@Column(name = "silver_two_price_card", attrName = "silverTwoPriceCard", label = "内容"),
									@Column(name = "gold_one_price_card", attrName = "goldOnePriceCard", label = "内容"),
									@Column(name = "gold_two_price_card", attrName = "goldTwoPriceCard", label = "内容"),
									
									@Column(name="img", label="小程序头像",attrName = "img"),})
						
					
					},orderBy = "a.create_date DESC")
public class ZtCardOrder extends DataEntity<ZtCardOrder>{

	private static final long serialVersionUID = 1L;
	
	private String order,status,orderstatus;
	private ZtCard ztCard;
	
	private Date orderTime,payTime;
	private Double price;//商品总价

	private Double balance;//余额
	private ZtAdmin ztAdmin;
	
	@JsonIgnore
	private Date createDate;
	@JsonIgnore
	private String updateBy;
	@JsonIgnore
	private String createBy;
	@JsonIgnore
	private Date updateDate;
	

	public Double getBalance() {
		return balance;
	}
	public void setBalance(Double balance) {
		this.balance = balance;
	}

	
	@JsonIgnore
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPayTime() {
		return payTime;
	}
	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public ZtAdmin getZtAdmin() {
		return ztAdmin;
	}
	public void setZtAdmin(ZtAdmin ztAdmin) {
		this.ztAdmin = ztAdmin;
	}
	public String getOrder() {
		return order;
	}
	public void setOrder(String order) {
		this.order = order;
	}
	public String getOrderstatus() {
		return orderstatus;
	}
	public void setOrderstatus(String orderstatus) {
		this.orderstatus = orderstatus;
	}
	public ZtCard getZtCard() {
		return ztCard;
	}
	public void setZtCard(ZtCard ztCard) {
		this.ztCard = ztCard;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}
	
}